class PetShop:
    welcome = "Welcome to our pet shop"
    __hiden = "We are a free pet shop"

    def __init__(self, name, animal_factory=None):
        self.name = name
        self.__sex = "male"
        self.pet_factory = animal_factory
    
    def show_pet(self):
        pet = self.pet_factory()
        print(f"We have a {self.__sex} {pet} named {self.name}")
        print(f"It says {pet.speak()}")


class Dog:
    def speak(self):
        return "wang wang"
    
    def __str__(self):
        return "Dog"


class Cat:
    def speak(self):
        return "miao miao"
    
    def __str__(self):
        return "Cat"


def main():
    """
    >>> dog_shop = PetShop("bobi", Dog)
    >>> cat_shop = PetShop("susu", Cat)
    >>> PetShop._PetShop__hiden
    'We are a free pet shop'
    >>> dog_shop.welcome
    'Welcome to our pet shop'
    >>> dog_shop.show_pet()
    We have a male Dog named bobi
    It says wang wang
    >>> cat_shop.show_pet()
    We have a male Cat named susu
    It says miao miao
    """


if __name__ == "__main__":
    import doctest

    doctest.testmod()